package com.CST.controller;


import com.CST.annotation.*;
import com.CST.common.constant.*;
import com.CST.entity.*;
import com.CST.service.*;
import io.swagger.annotations.*;

import java.util.*;

import org.springframework.beans.factory.annotation.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ly
 * @since 2021-09-23
 */
@Api(tags = {"基础数据"})
@RestController
@RequestMapping("/bdEnum")

public class BdEnumController {

    @Autowired
    private IBdEnumService targetService;


    @PostMapping("/saveOrUpdate")
    @ApiOperation("新建或编辑")
    @ResultObjectAnnotation(value = DmlTypeConstant.INSERT, successMessage = "新建或编辑成功!", errorMessage = "新建或编辑失败!")
    public Object saveOrUpdate(@RequestBody BdEnum BdEnum) {
        return targetService.saveOrUpdate(BdEnum);
    }


    @GetMapping("/getById/{id}")
    @ApiOperation("查看")
    @ResultObjectAnnotation(DmlTypeConstant.SELECT)
    public Object getById(@PathVariable String id) {
        return targetService.getById(id);
    }


    @DeleteMapping("/delete/{ids}")
    @ApiOperation("删除")
    @ResultObjectAnnotation(DmlTypeConstant.DELETE)
    public Object delete(@PathVariable List<String> ids) {
        return targetService.removeByIds(ids);
    }


}

